<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "hy_branch_resource".
 *
 * @property int $id 自增id
 * @property int $res_id 资源id
 * @property string $res_title 题名
 * @property int $type 资源类型 1图书，2期刊，3图片,4音频 5视频
 * @property int $br_id 行业分馆id
 * @property int $look_num 浏览数
 * @property string $created_at 创建时间
 * @property string $updated_at
 * @property string $deleted_at
 */
class BranchResource extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'hy_branch_resource';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['res_id', 'type', 'br_id', 'look_num'], 'integer'],
            [['br_id'], 'required'],
            [['created_at', 'updated_at', 'deleted_at'], 'safe'],
            [['res_title'], 'string', 'max' => 500],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'res_id' => 'Res ID',
            'res_title' => 'Res Title',
            'type' => 'Type',
            'br_id' => 'Br ID',
            'look_num' => 'Look Num',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
        ];
    }
}
